<?php
/**
 * redis sub(消息订阅端)
 * @ blog: phping.sinaapp.com
 * @date 2016-04-24 15:00
 */

$redis = new \Redis();
$redis->connect('114.215.222.20', 6445);
$redis->auth('rxres123456');
$redis->subscribe(array('redisChat'), 'callback');

// 回调函数,这里写处理逻辑
function callback($instance, $channelName, $message) {
 echo $channelName. "==>". $message;
}